package com.sc.oa.base;

import java.io.Serializable;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;

public interface BaseDao<T> {
	
	void save(T entity);
	void update(T entity);
	//批量删除
	void deleteByIds(Serializable ... ids);
	
	//清空所有
	void deleteAllObjects(Collection<T> entities);
	
	T getById(Serializable id);
	
	List<T> getByIds(Long[] ids);
	//查询所有的
	List<T> findAll();
	
	List<T> findObjectByConditionWithNoPage(String whereHql,Object[] values);
	List<T> findObjectByConditionWithPage(LinkedHashMap<String, String>oderby);
	//分页查询优化
	List<T> findObjectByConditionWithPage(String whereHql,Object[] values,LinkedHashMap<String, String>orderby,Pager p);
	List<T> findObjectByConditionWithNoPage(String whereHql,Object[] values,LinkedHashMap<String, String>orderby);
	//得到数
	int getObjectCountsByid(String whereHql,Object... values);
	
	
	

}
